package practice;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;


// 自定义快读 Read
class Read {
    StringTokenizer st = new StringTokenizer("");
    BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));

    String next() throws IOException {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(bf.readLine());
        }
        return st.nextToken();
    }

    String nextLine() throws IOException {
        return bf.readLine();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }
}

// 比较器
// 大根堆
class IntCmp implements Comparator<Integer> {
    public int compare(Integer o1, Integer o2) {
        return o2 - o1;
    }
}

public class practice03 {
    /**
     * 除以2 - 使用堆
     * @param args
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(), k = in.nextInt();
        PriorityQueue<Integer> heap = new PriorityQueue<>(new IntCmp());
        long sum = 0, x;
        for (int i = 0; i < n; i++) {
            x = in.nextLong();
            sum += x;
            if (x % 2 == 0) {
                heap.add((int)x);
            }
        }
        while (!heap.isEmpty() && k-- != 0) {
            long t = heap.poll() / 2;
            sum -= t;
            if (t % 2 == 0) {
                heap.add((int)t);
            }
        }
        System.out.println(sum);
    }

    /**
     * dd爱框框
     * @param args
     */
    // 滑动窗口
    public static void main2(String[] args) throws IOException {
        Read in = new Read();
        int n = in.nextInt(), x = in.nextInt();
        int[] arr = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            arr[i] = in.nextInt();
        }
        int left = 1, right = 1,sum = 0;
        int retLeft = -1, retRight = -1, retLen = n;
        while (right <= n) {
            // 进窗口
            sum += arr[right];
            // 判断
            while (sum >= x) {
                // 更新结果
                if (right - left + 1 < retLen) {
                    retLeft = left;
                    retRight = right;
                    retLen = right - left + 1;
                }
                // 出窗口
                sum -= arr[left++];
            }
            right++;
        }
        System.out.println(retLeft + " " + retRight);
    }


    /**
     * 简写单词
     * @param args
     */
    // 1
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        String str = in.nextLine().toUpperCase();
        char[] ch = str.toCharArray();
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < ch.length; i++) {
            if (i == 0) {
                stringBuilder.append(ch[i]);
            }
            if (ch[i] == ' ') {
                stringBuilder.append(ch[i + 1]);
            }
        }
        System.out.println(stringBuilder);
    }

    // 2
    public static void main11(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            char ch = in.next().charAt(0);
            if (ch >= 'a' && ch <= 'z') System.out.print((char)(ch - 32));
            else System.out.print(ch);
        }
    }
}
